package com.baizhi.service.impl;

import com.baizhi.dao.CategoryDao;
import com.baizhi.entity.Category;
import com.baizhi.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryDao categoryDao;
    @Override
    public void insertCategory(Category category) {
        categoryDao.insertCategory(category);
    }

    @Override
    public List<Category> selectAll() {
        List<Category> categories = categoryDao.selectAll();
        return categories;
    }

    @Override
    public List<Category> selectFirstCategory() {
        List<Category> categories = categoryDao.selectFirstCategory();
        return categories;
    }

    @Override
    public List<Category> selectSecondCategory() {
        List<Category> categories = categoryDao.selectSecondCategory();
        return categories;
    }

    @Override
    public void deleteCategory(Integer id) {
        categoryDao.deleteCategory(id);
    }
}
